<style type="text/css">
.normal_form[form-role="dialog"] {padding-top:30px;}
.normal_form[form-role="dialog"] .input-text{width:150px;}
</style>
<form name="dialogform" class="normal_form row-inline" form-role="dialog" onsubmit="return Core.Sys.Dialogform(this);" autocomplete="off">
    <div class="row">
        <div class="field_text">花名：</div>
        <input type="text" class="input-text" name="nickname" value="{$res['nickname'] ?? ''}" disabled style="width:150px;" />
    </div>
    <div class="row">
        <div class="field_text">手机号：</div>
        <input type="text" class="input-text" name="mobile" value="{$res['mobile'] ?? ''}" disabled style="width:150px;" />
    </div>
    <div class="row">
        <div class="field_text">真实姓名：</div>
        <input type="text" class="input-text" name="realname" value="{$res['realname'] ?? ''}" disabled style="width:150px;" />
    </div>
    <div class="row">
        <div class="field_text">提现金额(元)：</div>
        <input type="text" class="input-text" name="amount" value="{$res['amount'] ?? ''}" disabled style="width:150px;" />
    </div>
    <div class="row">
        <div class="field_text require">回复原因：</div>
        <textarea name="content" class="input-text require" maxlength="250" style="width:403px;height:80px;"></textarea>
    </div>
    <div class="row form-footer-bar">
        <p class="colortip"></p>
        <button class="btn" role="btn-cancel">取消</button>
        <button class="btn btn-primary" type="submit" role="btn-submit">保存</button>
    </div>
</form>
<script type="text/javascript">
Core.Sys.Dialogform = function(form){
    var form = $(form);
    var p    = {
        'content'  : form.find('textarea[name="content"]').val(),
	}

    if (!Core.rule('*',p['content'])){
		form.find("p.colortip").html('请输入回复原因!');return false;
	}

	form.find(":button").attr('disabled','disabled');
	$.ajax({type : "POST",dataType: "json",cache : false, url : "{$_G['_mca_']}/id/{$res['id'] ?? 0}?r="+Math.random(),data : p,success: function(data){
	   try{
		   if (data['state'] == 'y'){
                $('#datalist').datagrid('reload');$(form).dialogClose();
		   } else {
                form.find(":button").removeAttr('disabled');form.find("p.colortip").html(data['msg']);return false;
		   }
	   }catch(e){form.find(":button").removeAttr('disabled');form.find("p.colortip").html('数据提交失败!');return false;}
	}});
	return false;
}
$(function(){});
</script>